namespace IconPatcher
{
    using System;

    using IconPatcher.Annotations;

    using ManyConsole;

    [UsedImplicitly]
    public class InformationCommand : ConsoleCommand
    {
        public InformationCommand()
        {
            SkipsCommandSummaryBeforeRunning();

            IsCommand("info", "Displays the current Visual Studio culture information.");
        }

        public override int Run(string[] remainingArguments)
        {
            Console.WriteLine("Version: {0}", Program.Version());
            Console.WriteLine();
            if (Program.Support2010)
            {
                Console.WriteLine("The installed Visual Studio 2010 languages are:");
                foreach (var language in Program.Languages2010)
                {
                    Console.WriteLine("\t{0} - {1}", language, System.Globalization.CultureInfo.GetCultureInfo(Convert.ToInt32(language)).DisplayName);
                }
            }
            else
            {
                Console.WriteLine("Visual Studio 2010 support is disabled.");
            }

            Console.WriteLine();

            if (Program.Support2012)
            {
                Console.WriteLine("The installed Visual Studio 2012 languages are:");
                foreach (var language in Program.Languages2012)
                {
                    Console.WriteLine("\t{0} - {1}", language, System.Globalization.CultureInfo.GetCultureInfo(Convert.ToInt32(language)).DisplayName);
                }
            }
            else
            {
                Console.WriteLine("Visual Studio 2012 support is disabled.");
            }

            return 0;
        }
    }
}